package com.fateai.module.swipeItemHelper;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class TestDataGenerator {

    // 扩展名字库以增加多样性
    private static final String[] FIRST_NAMES = {
            "John", "Emma", "Michael", "Sophia", "William", "Olivia", "James", "Ava",
            "Robert", "Mia", "David", "Charlotte", "Joseph", "Amelia", "Thomas", "Harper",
            "Daniel", "Evelyn", "Matthew", "Abigail", "Andrew", "Elizabeth", "Joshua", "Sofia",
            "George", "Avery", "Ryan", "Ella", "Nicholas", "Scarlett", "Anthony", "Grace"
    };

    private static final String[] LAST_NAMES = {
            "Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller", "Wilson",
            "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White", "Harris", "Martin",
            "Thompson", "Garcia", "Martinez", "Robinson", "Clark", "Rodriguez", "Lewis", "Lee"
    };

    private static final String[] DOMAINS = {
            "gmail.com", "yahoo.com", "hotmail.com", "outlook.com", "example.com",
            "company.org", "mail.net", "service.io", "domain.co", "business.info"
    };

    public static List<UserData> generateTestUsers(int count) {
        List<UserData> userList = new ArrayList<>(count); // 预先设置容量
        Random random = new Random();

        for (int i = 0; i < count; i++) {
            UserData user = new UserData();

            // 组合名字和姓氏，增加多样性
            String firstName = FIRST_NAMES[random.nextInt(FIRST_NAMES.length)];
            String lastName = LAST_NAMES[random.nextInt(LAST_NAMES.length)];
            user.name = firstName + " " + lastName;

            // 随机年龄 (18-65)
            user.age = 18 + random.nextInt(48);

            // 更丰富的邮箱生成规则
            String emailPrefix = firstName.toLowerCase() + "." +
                    lastName.toLowerCase() + (random.nextInt(900) + 100); // 三位数
            user.email = emailPrefix + "@" + DOMAINS[random.nextInt(DOMAINS.length)];

            userList.add(user);
        }

        return userList;
    }
}
